// 歌手信息类

export class Singer {
  // 传入一个对象
  constructor({id, name, picUrl}) {
    this.id = id
    this.name = name
    this.avatar = picUrl
  }
}

// 工厂方式创建类实例
export function createSinger(singer) {
  return new Singer({
    id: singer.id,
    name: singer.name,
    picUrl: singer.picUrl
  })
}
